<p>With regular expressions syntax, it’s possible to express the same thing in many ways. For example, to match a two-digit number, one could write
<code>[0-9]{2,2}</code> or <code>\d{2}</code>. Latter is not only shorter in terms of expression length, but also easier to read and thus to maintain.
This rule recommends to replace some bulky quantifiers and character classes with more concise equivalents:</p>
<ul>
  <li> <code>\d</code> for <code>[0-9]</code> and <code>\D</code> for <code>[^0-9]</code> </li>
  <li> <code>\w</code> for <code>[A-Za-z0-9_]</code> and <code>\W</code> for <code>[^A-Za-z0-9_]</code> </li>
  <li> <code>.</code> for character classes matching everything (e.g. <code>[\w\W]</code>, <code>[\d\D]</code>, or <code>[\s\S]</code> with
  <code>s</code> flag) </li>
  <li> <code>x?</code> for <code>x{0,1}</code>, <code>x*</code> for <code>x{0,}</code>, <code>x+</code> for <code>x{1,}</code>, <code>x{N}</code> for
  <code>x{N,N}</code> </li>
</ul>
<h2>Noncompliant Code Example</h2>
<pre>
"[0-9]" // Noncompliant - same as "\\d"
"[^0-9]" // Noncompliant - same as "\\D"
"[A-Za-z0-9_]" // Noncompliant - same as "\\w"
"[\\w\\W]" // Noncompliant - same as "."
"a{0,}" // Noncompliant - same as "a*"
</pre>
<h2>Compliant Solution</h2>
<pre>
"\\d"
"\\D"
"\\w"
"."
"a*"
</pre>

